<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="author" content="lzyy" />
<!--
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="style/jqModal.css" type="text/css" media="screen"/>
<script src="script/jquery-1.3.1.min.js" type="text/javascript"></script>
<script src="script/jqModal.js" type="text/javascript"></script>
-->
<?php
echo html::stylesheet(array(
	'application/views/style/style',
	'application/views/style/jqModal',
	));
echo html::script(array(
	'application/views/script/jquery-1.3.1.min',
	'application/views/script/jqModal',
	));
?>

<script type="text/javascript" language="javascript" charset="utf-8">
    homeUrl = '<?php echo url::site();?>';
    //弹出窗口，并刷新页面
    function alertAndRefresh(msg)
    {
        alert(msg);
        location = homeUrl;
    }
	//用键盘操作上一页，下一页
	$(document).keydown(function(event){
		//alert(event.keyCode);
		switch(event.keyCode)
		{
			case 37:
				if($('.page a:contains("上一页")').html()!=null)
				{
					location.href=($('.page a:first').attr('href'));
				}
				break;
			case 39:
				if($('.page a:contains("下一页")').html()!=null)
				{
					location.href=($('.page a:last').attr('href'));
				}
				break;
		}
	})
	$(document).ready(function(){
        //高亮按钮
        <?php
        if($currentHl == 'collect')
        {
        ?>
        $("#header .collect a").addClass('navhl');
        <?php
        }
        if($currentHl == 'pub')
        {
        ?>
        $("#header .pub a").addClass('navhl');
        <?php
        }
        ?>

		//调整发布的图片大小
		$('.picshow img').each(function(i){
			var src = $(this).attr('src');
			var tmp_img = new Image();
			tmp_img.src = src;
			var width = tmp_img.width;
			if(width>480)
			{
				$(this).width(480);
			}
		});

		$("#pubtxt").jqm();
		$("#pubtxt").jqmAddClose(".closebtn");
		$("#publink").jqm();
		$("#publink").jqmAddClose(".closebtn");
		$("#pubpic").jqm();
		$("#pubpic").jqmAddClose(".closebtn");
		$("#pubvideo").jqm();
		$("#pubvideo").jqmAddClose(".closebtn");
		$("#setinfo").jqm({trigger:'li a.editinfo'});
		$("#setinfo").jqmAddClose(".closebtn");
		$("#login").jqm({trigger:'li.login a'});
		$("#login").jqmAddClose(".closebtn");
		$("#reg").jqm({trigger:'li.reg a'});
		$("#reg").jqmAddClose(".closebtn");
        $("#del").jqm();
        $("#del").jqmAddClose("#del .cancel");

		//图像上传，点击切换图像源
		$('#netpic').click(function(){
			$('.netpic').show();
			$('.localpic').hide();
		});
		$('#localpic').click(function(){
			$('.netpic').hide();
			$('.localpic').show();
		});

        //添加文本监听
        $("li.txt a").click(function(){
            $("#pubtxt :input[type='submit']").val('发  布');
            $("#pubtxt :input[name='article_id']").val('');//给hidden input赋值
            $("#pubtxt").jqmShow();
        });

        //编辑文本监听
        $("#container .txt .edit_txt").click(function(){
            $("#pubtxt").jqmShow();
            $("#pubtxt :input[type='submit']").val('更  新');//将发布按钮的字变为'更新''
            $("#pubtxt :input[name='article_id']").val($(this).attr('art_id'));//给hidden input赋值
            $("#pubtxt :input[name='intro']").val(($(this).parent().parent().find('.titletxt').text()));//填空
            //将<br>转换为\n
            textareaText = $(this).parent().parent().find('.intro p').html().replace(/<br>/g,'\n');
            $("#pubtxt textarea[name='content']").val(textareaText);
        });


        //添加链接监听
        $("li.link a").click(function(){
            $("#publink :input[type='submit']").val('发  布');
            $("#publink :input[name='article_id']").val('');//清空hidden input值
            $("#publink").jqmShow();
        });

        //编辑链接监听
        $("#container .link .edit_link").click(function(){
            //alert('dd');
            $("#publink").jqmShow();
            $("#publink :input[type='submit']").val('更  新');//将发布按钮的字变为'更新''
            $("#publink :input[name='article_id']").val($(this).attr('art_id'));//给hidden input赋值
            $("#publink :input[name='content']").val(($(this).parent().parent().find('.titlelink a').attr('href')));//填空
            $("#publink :input[name='linktitle']").val(($(this).parent().parent().find('.titlelink').text()));//填空
            //将<br>转换为\n
            textareaText = $(this).parent().parent().find('.intro p').html().replace(/<br>/g,'\n');
            $("#publink textarea[name='intro']").val(textareaText);
        });

        //添加视频监听
        $("li.video a").click(function(){
            $("#pubvideo :input[type='submit']").val('发  布');
            $("#pubvideo :input[name='article_id']").val('');//给hidden input赋值
			$("#pubvideo textarea").val('');
            $("#pubvideo").jqmShow();
        });

        //编辑视频监听
        $("#container .video .edit_video").click(function(){
            $("#pubvideo").jqmShow();
            $("#pubvideo :input[type='submit']").val('更  新');//将发布按钮的字变为'更新''
            $("#pubvideo :input[name='article_id']").val($(this).attr('art_id'));//给hidden input赋值
            $("#pubvideo :input[name='content']").val(($(this).parent().parent().find('.videocontent').html().replace(/(^\s*)|(\s*$)/g, "")));//填空
            //将<br>转换为\n
            textareaText = $(this).parent().parent().find('.intro p').html().replace(/<br>/g,'\n');
            $("#pubvideo textarea[name='intro']").val(textareaText);
        });

		//添加图像监听
		$("li.pic a").click(function(){
            $("#pubpic :input[type='submit']").val('发  布');
            $("#pubpic :input[name='article_id']").val('');//给hidden input赋值
            $("#pubpic").jqmShow();
		});

		//编辑图像监听
        $("#container .pic .edit_pic").click(function(){
            $("#pubpic").jqmShow();
            $("#pubpic :input[type='submit']").val('更  新');//将发布按钮的字变为'更新''
            $("#pubpic :input[name='article_id']").val($(this).attr('art_id'));//给hidden input赋值
            //将<br>转换为\n
            textareaText = $(this).parent().parent().find('.intro p').html().replace(/<br>/g,'\n');
            $("#pubpic textarea[name='intro']").val(textareaText);
			//根据图片的类型，显示相应的框
			if($(this).attr('type')=='0')
			{
				//网络图片
				$('#netpic').checked;
				$('.netpic').show();
				$('.localpic').hide();
				$("#pubpic :input[name='content']").val(($(this).parent().parent().find('.picshow a img').attr('src')));//填空
			}
        });

        //删除信息
		$("#container .func a[class^='del_']").click(function(){
            $("#del").jqmShow();
            $("#del form :input[name='article_id']").val($(this).attr('art_id'));
        });

        $("#del form").submit(function(){
            $.post('<?php echo url::site('default/delinfo');?>', {article_id:$("#del form :input[name='article_id']").val()} , function(data){onDel(data);});
            return false;
        });

        function onDel(data)
        {
            if(data=='0')
            {
                alert('删除失败:(');
            }
            if(data=='-1')
            {
                alert('无权删除');
            }
            else
            {
                location.href=homeUrl
            }
        }


        //用户注册
        $('#reg form').submit(function(){
            $("#username_warn").hide();
            $("#password_warn").hide();
			$("#username_duplicate_warn").hide();
            formData = $('#reg form').serializeArray();
            $.post('<?php echo url::site('default/reg');?>', formData , function(data){onReg(data);});
            return false;
        });

        function onReg(data)
        {
            if(data == 1)
            {
                location.href=homeUrl
            }
            else
            {
                if(data.indexOf('username')!==-1)
                {
                    $("#username_warn").show();
                }
                if(data.indexOf('password')!==-1)
                {
                    $("#password_warn").show();
                }
				if(data == '-2')//用户名已被注册
				{
					$("#username_duplicate_warn").show();
				}
            }
        }

        //用户登录
        $("#login form").submit(function(){
            formData = $(this).serializeArray();
            $.post('<?php echo url::site("default/login");?>',formData,function(data){onLogin(data)});
            return false;
        });

        function onLogin(data)
        {
            if(data=='1')
            {
                location.href=homeUrl
            }
            else
            {
                $("#login_error").show();
            }
        }

        //发表文字信息
        $('#pubtxt form').submit(function(){
            $('#pubtxt_warn').hide();
            formData = $(this).serializeArray();
            //alert(formData);

            $.post('<?php echo url::site("default/pubtxt");?>',formData,function(data){onTxtSubmit(data)});
            return false;
        });

        function onTxtSubmit(data)
        {
            if(data == '0')
            {
                $('#pubtxt_warn').show();
            }
            else if(data=='-1')
            {
                alertAndRefresh('请登陆后再使用此功能');
            }
            else
            {
                location.href=homeUrl
            }
        }

        //发布链接信息
        $('#publink form').submit(function(){
            $('#publink_warn').hide();
            $('#publinktitle_warn').hide();
            formData = $(this).serializeArray();
            
            
            $.post('<?php echo url::site("default/publink");?>',formData,function(data){onLinkSubmit(data)});
            return false;
        });

        function onLinkSubmit(data)
        {
            if(data == '0')
            {
                $('#publink_warn').show();
            }
            else if(data=='-1')
            {
                alertAndRefresh('请登陆后再使用此功能');
            }
            else if(data=='-2')
            {
                $("#publinktitle_warn").show();
            }
            else
            {
                location.href=homeUrl
            }
        }

        //发布视频信息
        $('#pubvideo form').submit(function(){
            $('#pubvideo_warn').hide();
            formData = $(this).serializeArray();
            //alert(formData);
            //分离出视频地址
            var videoArr = formData[0].value.split(' ');
            var videoUrl = '';
            for(var i=0; i<videoArr.length; i++)
            {
                if(videoArr[i].indexOf('src')!==-1)
                {
                    var video = videoArr[i].split('=');
                    videoUrl = (video[1].replace('"',''));
                    break;
                }
            }
            formData[0].value = videoUrl;

            $.post('<?php echo url::site("default/pubvideo");?>',formData,function(data){onVideoSubmit(data)});
            return false;
        });

        function onVideoSubmit(data)
        {
            if(data == '0')
            {
                $('#pubtxt_warn').show();
            }
            else if(data=='-1')
            {
                alertAndRefresh('请登陆后再使用此功能');
            }
            else
            {
                location.href=homeUrl
            }
        }

        //加入收藏
        $(".addCollect").live("click",function(){
            $(this).attr('class','removeCollect');
            $(this).text('取消收藏');
            $.post("<?php echo url::site('default/addcollect');?>",{art_id:$(this).attr('art_id')},function(data){onAddCollect(data)})
        });

        //取消收藏
        $(".removeCollect").live("click",function(){
			$(this).attr('class','addCollect');
			$(this).text('加入收藏');
           $.post("<?php echo url::site('default/removecollect');?>",{art_id:$(this).attr('art_id')},function(data){onRemoveCollect(data)})
        });

        function onAddCollect(data,dest)
        {
            if(data=='0')
            {
                //alert('添加收藏失败');
            }
            else
            {
                //alert('添加收藏成功');

            }
        }

		function onRemoveCollect(data,dest)
		{
			if(data=='1')
			{

			}
		}

		//查看回复
		$(".viewcomment a").live('click',function(){
			art_id = $(this).attr('art_id');
			
			if($('.commentwrapper[art_id="'+art_id+'"]').length==0)
				$.getJSON('<?php echo url::site('default/viewcmt');?>/'+art_id,function(data){dealCmtJsonData(data,art_id);});
			else if($('.commentwrapper[art_id="'+art_id+'"]').css('display')=='none')
				$('.commentwrapper[art_id="'+art_id+'"]').slideDown('normal');
			else
				$('.commentwrapper[art_id="'+art_id+'"]').slideUp('normal');

			$('.commentwrapper').each(function(i){
				if($(this).attr('art_id')!=art_id)
					$(this).slideUp();
			});
				
		});

		//处理回复的json数据
		function dealCmtJsonData(data,art_id)
		{
			
			$str = '';
			for(var i=0;i<data.length;i++)
			{
				userLink = '<?php echo url::site('default/viewuser').'/';?>'+data[i].user_id;
				<?php $urlBase = url::base();?>
				if(data[i].avatar=='') data[i].avatar='<?php echo $urlBase.'application/upload/avatar/default.png'; ?>';
				else data[i].avatar = '<?php echo $urlBase.'application/upload/avatar/'; ?>'+data[i].avatar;
				if(i%2==0) evenOdd = 'even';
				else evenOdd = 'odd';
				$str += '<div class="comment clearfix '+evenOdd+'"><a href="'+userLink+'"><img title="'+data[i].username+'" src="'+data[i].avatar+'"></img></a><p>'+data[i].content+'</p><span class="date">'+data[i].pubdate+'</span></div>';
			}
			$cmtstr = '<div class="commentwrapper" art_id='+art_id+'>'+$str+'<div class="alert hide" warn_id="cmt_empty_warn">评论不能为空</div><div class="alert hide" warn_id="cmt_not_login">你尚未登陆或已超时</div><form class="pubcmt" action="<?php echo url::site('default/addcmt'); ?>/'+art_id+'" method="post"><textarea name="content"></textarea><p><input type="submit" value="发表评论" /></p></form></div>';
			$('.viewcomment a[art_id="'+art_id+'"]').parent().after($cmtstr);
			$('.commentwrapper[art_id="'+art_id+'"]').hide();
			$('.commentwrapper[art_id="'+art_id+'"]').slideDown('normal');
			$('form[class="pubcmt"]').submit(function(){submitCmt(this);return false;})
		}

		//发表评论
		function submitCmt(thisForm)
		{
			$('div[warn_id="cmt_not_login"]').hide();
			$('div[warn_id="cmt_empty_warn"]').hide();
			formData = $(thisForm).serializeArray();
			action = $(thisForm).attr('action');
			$.post(action,formData,function(data){onCmtSubmit(data)});
		}

		function onCmtSubmit(data)
		{
			if(data == '-2')
			{
				$('div[warn_id="cmt_empty_warn"]').show();
			}
			else if(data == '-1')
			{
				$('div[warn_id="cmt_not_login"]').show();
			}
			else
			{
				data = eval('('+data+')');
				if(data.avatar=='') data.avatar='<?php echo $urlBase.'application/upload/avatar/default.png'; ?>';
				else data.avatar = '<?php echo $urlBase.'application/upload/avatar/'; ?>'+data.avatar;
				art_id = data.art_id;
				$length = $('div[art_id="'+art_id+'"] div').length;
				evenOdd = $length%2==0?'even':'odd';
				userLink = '<?php echo url::site('default/viewuser').'/';?>'+data.user_id;
				$str = '<div class="hide comment clearfix '+evenOdd+'"><a href="'+userLink+'"><img src="'+data.avatar+'"></img></a><p>'+data.content+'</p><span class="date">'+data.pubdate+'</span></div>';
				if($('div[art_id="'+art_id+'"] div:visible').length==0)
				{
					$('div[art_id="'+art_id+'"] div:hidden:first').before($str);
					$('div[art_id="'+art_id+'"] div:hidden:first').slideDown();
				}
				else
				{
					$('div[art_id="'+art_id+'"] div:visible:last').after($str);
					$('div[art_id="'+art_id+'"] div:hidden:first').slideDown();
				}
			}
		}


	});	
</script>
		
<title>分享互联网，快乐你我他</title>
</head>

<body>
<div id="header">
	<div class="inner">
		<a href="<?php echo url::site(); ?>"><div id="logo" style="cursor:pointer"></div></a>
		<?php
        $session = Session::instance();
        if(($session->get('user_id')!='') && ($session->get('user_id')!='undefined')){
        ?>
		<ul class="set">
			<li><a href="#" class="editinfo">修改资料</a></li>
			<li><a class="logout" href="<?php echo url::site('default/logout');?>">退出</a></li>
		</ul>
		<p class="spliter"></p>
		<ul class="mine">
			<li class="collect"><a href="<?php echo url::site('default/mycollect'); ?>">我的收藏(<?php echo count($collects);?>)</a></li>
			<li class="pub"><a href="<?php echo url::site('default/mypub'); ?>">我发表过的(<?php echo count($pubs); ?>)</a></li>
		</ul>
		<p class="spliter"></p>
		<ul class="pub">
			<li class="pic"><a href="#">发图片</a></li>
			<li class="txt"><a href="#">发文本</a></li>
			<li class="link"><a href="#">发链接</a></li>
			<li class="video"><a href="#">发视频</a></li>
		</ul>
		<?php }else{ ?>
		<ul class="reglogin">
			<li class="reg"><a href="#">注册</a></li>
			<li class="login"><a href="#">登陆</a></li>
		</ul>
        <? } ?>
	</div>
</div>

<div id="container">
	<div class="inner">
    <?php
		$user_id = $session->get('user_id');
        for($i=0;$i<count($articles);$i++)
        {
			//echo Kohana::debug(count($articles[$i]->comments));
            $urlBase = url::base();
            if($articles[$i]->user->avatar=='')
            {
                $avatarUrl = $urlBase.'application/upload/avatar/default.png';
            }
            else
            {
                $avatarUrl = $urlBase.'application/upload/avatar/'.$articles[$i]->user->avatar;
            }
            $username = $articles[$i]->user->username;
            $time = date("y/m/d H:i",$articles[$i]->pubdate);
            $art_id = $articles[$i]->id;
			if($user_id == $articles[$i]->user_id)
			{
				$isAuthor = true;
				$func1 = '<p class="func"><a href="javascript:void(0);" art_id='.$art_id.' class="edit_txt">编辑</a> | <a href="javascript:void(0);" art_id='.$art_id.' class="del_txt">删除</a>';
				$func2 = '<p class="func"><a href="javascript:void(0);" art_id='.$art_id.' class="edit_link">编辑</a> | <a href="javascript:void(0);" art_id='.$art_id.' class="del_link">删除</a>';
				$func3 = '<p class="func"><a href="javascript:void(0);" art_id='.$art_id.' class="edit_video">编辑</a> | <a href="javascript:void(0);" art_id='.$art_id.' class="del_video">删除</a>';
				$func4 = '<p class="func"><a href="javascript:void(0);" art_id='.$art_id.' class="edit_pic">编辑</a> | <a href="javascript:void(0);" art_id='.$art_id.' class="del_pic">删除</a>';
				if(!in_array($art_id,$collects))
				{
					
					$func1 .= '<a href="javascript:void(0);" art_id='.$art_id.' class="addCollect" style="padding-left:10px"> 加入收藏</a></p>';
					$func2 .= '<a href="javascript:void(0);" art_id='.$art_id.' class="addCollect" style="padding-left:10px"> 加入收藏</a></p>';
					$func3 .= '<a href="javascript:void(0);" art_id='.$art_id.' class="addCollect" style="padding-left:10px"> 加入收藏</a></p>';
					$func4 .= '<a href="javascript:void(0);" art_id='.$art_id.' class="addCollect" style="padding-left:10px"> 加入收藏</a></p>';
				}
				else
				{
					$func1 .= '<a href="javascript:void(0);" art_id='.$art_id.' class="removeCollect" style="padding-left:10px"> 取消收藏</a></p>';
					$func2 .= '<a href="javascript:void(0);" art_id='.$art_id.' class="removeCollect" style="padding-left:10px"> 取消收藏</a></p>';
					$func3 .= '<a href="javascript:void(0);" art_id='.$art_id.' class="removeCollect" style="padding-left:10px"> 取消收藏</a></p>';
					$func4 .= '<a href="javascript:void(0);" art_id='.$art_id.' class="removeCollect" style="padding-left:10px"> 取消收藏</a></p>';
				}
			}
            else if($user_id =='' || $user_id == 'undefined')
            {
                $func1 = $func2 = $func3 = $func4 = '';
            }
			else
			{
				$isAuthor = false;
                if(!in_array($art_id,$collects))
                {
                    $func1 = $func2 = $func3 = $func4 = '<p class="func"><a href="javascript:void(0);" art_id='.$art_id.' class="addCollect">加入收藏</a></p>';
                }
                else
                {
                    $func1 = $func2 = $func3 = $func4 = '<p class="func"><a href="javascript:void(0);" art_id='.$art_id.' class="removeCollect">取消收藏</a></p>';
                }
			}
			$cmtNum = count($articles[$i]->comments);
			$userLink = url::site('default/viewuser').'/'.$articles[$i]->user_id;
            switch($articles[$i]->type)
            {
                
                //文本内容
                case 1:
                    $title = $articles[$i]->intro==''?'':'<p class="titletxt">'.$articles[$i]->intro.'</p>';
                    $intro = preg_replace("/\n/","<br>",$articles[$i]->content);
                    echo <<<EOT
                    <div class="item txt">
			<div class="avatar">
				<a href="$userLink"><img src="$avatarUrl" title="$username" /></a>
			</div>
			<div class="content">
				<div class="contentinner">
					$func1
					$title
					<div class="intro">
						<p>$intro</p>
					</div>
					<span class="date">$time</span>
					<p class="viewcomment"><a href="javascript:void(0);" art_id=$art_id>查看回复($cmtNum)</a></p>
				</div>
			</div>
		</div>
EOT;
                break;

                //链接
                case 2:
                    $link = $articles[$i]->content;
                    $linktitle = $articles[$i]->linktitle;
                    $intro = $articles[$i]->intro;
                    echo <<<EOT
                    <div class="item link">
			<div class="avatar">
				<a href="$userLink"><img src="$avatarUrl" title="$username" /></a>
			</div>
			<div class="content">
				<div class="contentinner">
					$func2
					<p class="titlelink"><a href="$link" target="_blank">$linktitle</a></p>
					<div class="intro">
						<p>$intro</p>
					</div>
					<span class="date">$time</span>
					<p class="viewcomment"><a href="javascript:void(0);" art_id=$art_id>查看回复($cmtNum)</a></p>
				</div>
			</div>
		</div>
EOT;
                    break;

                //视频
                case 3:
                    $intro = $articles[$i]->intro;
                    $videoUrl = $articles[$i]->content;
                    echo <<<EOT
                <div class="item video">
                    <div class="avatar">
                    <a href="$userLink"><img src="$avatarUrl" title="$username" /></a>
                    </div>
                    <div class="content">
				<div class="contentinner">
					$func3
                    <p class="videocontent">
						<embed src="$videoUrl" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" wmode="transparent" type="application/x-shockwave-flash"></embed>
					<div class="intro">
                    </p>
						<p>$intro</p>
					</div>
					<span class="date">$time</span>
					<p class="viewcomment"><a href="javascript:void(0);" art_id=$art_id>查看回复($cmtNum)</a></p>
				</div>
                </div>
			</div>
EOT;
                    break;
				//图片
				case 4:
					$intro = $articles[$i]->intro;
					$picUrl = $articles[$i]->content;
					$picSource = 0;//来源于网络
					if(!strstr($picUrl,'http://'))
					{
						$picUrl = 'http://'.Kohana::config('config.site_domain').'application/upload/'.$picUrl;
						$picSource = 1;//来源于本地
					}
                    echo <<<EOT
                <div class="item pic">
                    <div class="avatar">
                    <a href="$userLink"><img src="$avatarUrl" title="$username" /></a>
                    </div>
                    <div class="content">
				<div class="contentinner">
					$func4
					<p class="picshow"><a href="$picUrl" target="_blank"><img src='$picUrl' /></a></p>
					<div class="intro">
                    </p>
						<p>$intro</p>
					</div>
					<span class="date">$time</span>
					<p class="viewcomment"><a href="javascript:void(0);" art_id=$art_id>查看回复($cmtNum)</a></p>
				</div>
				</div>
EOT;
				break;
				
				default:
					break;
            }
        }
    ?>

		<div class="page">
		<?php echo $prevPage;?> &nbsp;&nbsp;| &nbsp;<?php echo $nextPage;?>
		</div>
	</div>
</div>

<!-- 发布框 -->
<div id="pubtxt" class="jqmWindow">
	<div class="pubhead">
		<p class="closebtn"></p>
		<h3>发布文字</h3>
	</div>
	<form action="" method="post" class="pubform">
		<h3>标题(可选)</h3>
		<p><input type="text" name="intro" value="" /></p>
		<h3>内容</h3><span class="alert hide" id="pubtxt_warn" style="padding:5px 5px 5px 0px">内容不能为空</span>
		<p><textarea name="content"></textarea></p>
        <input type="hidden" name="article_id" value='' />
		<p><input type="submit" value="发 &nbsp;布" class="submit"/></p>
	</form>
</div>

<div id="publink" class="jqmWindow">
	<div class="pubhead">
		<p class="closebtn"></p>
		<h3>发布链接</h3>
	</div>
	<form action="" method="post" class="pubform">
		<h3>链接</h3><span class="alert hide" id="publink_warn" style="padding:5px 5px 5px 0px">链接不能为空</span>
		<p><input type="text" name="content" value="http://" /></p>
        <h3>链接标题</h3><span class="alert hide" id="publinktitle_warn" style="padding:5px 5px 5px 0px">链接标题不能为空</span>
		<p><input type="text" name="linktitle" value="" /></p>
		<h3>说明(可选)</h3>
		<p><textarea name="intro"></textarea></p>
        <input type="hidden" name="article_id" value='' />
		<p><input type="submit" value="发 &nbsp;布" class="submit"/></p>
	</form>
</div>

<div id="pubpic" class="jqmWindow">
	<div class="pubhead">
		<p class="closebtn"></p>
		<h3>发布图片</h3>
	</div>
	<form method="post" class="pubform" enctype="multipart/form-data" action="<?php echo url::site('default/pubpic'); ?>">
		<h3>来源</h3><span class="alert hide" id="pubpic_warn" style="padding:5px 5px 5px 0px">图像源不能为空</span>
		<div class="source">
			<input type="radio" name="source" value="0" class="radio" checked id="netpic" /> <span>网络</span>
			<input type="radio" name="source" value="1" class="radio" id="localpic" /> <span>本地</span>
		</div>
		<p class="netpic"><input type="text" name="content" value="http://" /></p>
		<p class="localpic hide"><input type="file" name="pic" /></p>
		<h3>说明(可选)</h3>
		<p><textarea name="intro"></textarea></p>
		<input type="hidden" name="article_id" value=""  />
		<p><input type="submit" value="发 &nbsp;布" class="submit"/></p>
	</form>
</div>

<div id="pubvideo" class="jqmWindow">
	<div class="pubhead">
		<p class="closebtn"></p>
		<h3>发布视频</h3>
	</div>
	<form action="" method="post" class="pubform">
		<h3>视频代码</h3>
        <span class="alert hide" id="pubvideo_warn" style="padding:5px 5px 5px 0px">
        代码不能为空，且不能是url。
        <br>
        正确格式：
        <br>
        &lt;embed src="http://www.youtube.com/v/7Q2r1UfjKBM&hl=zh_CN&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;
        </span>
		<p><textarea name="content" class="videocode">
        
        </textarea></p>
		<h3>说明(可选)</h3>
		<p><textarea name="intro" class="intro"></textarea></p>
        <input type="hidden" name="article_id" value='' />
		<p><input type="submit" value="发 &nbsp;布" class="submit"/></p>
	</form>
</div>

<div id="setinfo" class="jqmWindow">
	<div class="pubhead">
		<p class="closebtn"></p>
		<h3>修改资料</h3>
	</div>
	<form action="<?php echo url::site('default/editinfo') ?>" method="post" class="pubform" enctype="multipart/form-data">
		<h3>上传头像</h3>
		<p><input type="file" name="avatar" /></p>
		<h3>修改密码(不修改请留空)</h3>
		<p><label>旧密码：</label><input type="password" name="oldpwd" value="" /></p>
		<p><label>新密码：</label><input type="password" name="newpwd" value="" /></p>
		<p><label>再一遍：</label><input type="password" name="newpwdagain" value="" /></p>
		<p><input type="submit" value="提 &nbsp;交" class="submit"/></p>
	</form>
</div>

<div id="login" class="jqmWindow">
	<div class="pubhead">
		<p class="closebtn"></p>
		<h3>用户登录</h3>
	</div>
    <div class="hide alert" id="login_error">用户名或密码错误</div>
	<form action="" method="post" class="pubform">
		<h3>用户名</h3>
		<p><input type="text" name="username" /></p>
		<h3>密码</h3>
		<p><input type="password" name="password" /></p>
		<p><input type="submit" value="登 &nbsp;录" class="submit"/></p>
	</form>
</div>

<div id="reg" class="jqmWindow">
	<div class="pubhead">
		<p class="closebtn"></p>
		<h3>用户注册</h3>
	</div>
	<form action="" method="post" class="pubform" >
		<h3>用户名</h3><span class="hide alert" id="username_warn" style="padding:5px 5px 5px 0">用户名不能为空</span>
		<span class="hide alert" id="username_duplicate_warn" style="padding:5px 5px 5px 0">该用户名已被注册</span>
		<p><input type="text" name="username" /></p>
		<h3>密码</h3>
		<p><input type="password" name="password" /></p>
		<h3>密码确认</h3><span class="hide alert" id="password_warn" style="padding:5px 5px 5px 0">两次密码不符</span>
		<p><input type="password" name="password_again" /></p>
		<p><input type="submit" value="注 &nbsp;册" class="submit"/></p>
	</form>
</div>

<div id="del" class="jqmWindow">
    确定删除吗？(此操作不可恢复)
    <form action="" method="post">
        <input type="submit" value="确定" />
        <input type="hidden" name="article_id" value="" />
        <button class="cancel">取消</button>
    </form>
</div>

<div id="ie6_warn" class="jqmWindow" style="padding:15px;border:1px solid #333">
很不幸，你在用IE6，可能你不知道，网站开发人员耗费了多少青春在这款浏览器上，而这些时间本可以用来与女朋友逛街，与家人聊天
等等更有意义的事情上。<br><span style="color:red">所以用Firefox或者Chrome吧，他们会感激你的。</span> 
</div>
<!--[if IE 6]>
	<script>
		$('#ie6_warn').jqm({modal:true,trigger:false});
		$('#ie6_warn').jqmShow();
	</script>	
<![endif]-->
</body>
